package com.company.bkst.service;

import java.util.ArrayList;

import javax.jws.WebService;
import com.company.bkst.Book;
import com.company.bkst.dao.BookDAO;
import com.company.bkst.service.request.BookRequest;

@WebService(endpointInterface = "com.company.bkst.service.BookServiceSEI", portName = "BookServicePort", serviceName = "BookServices")
public class BookService implements BookServiceSEI {

	public Book getBook(BookRequest bookRequest) {
		BookDAO dao = new BookDAO();
		return dao.getBook(bookRequest.getBookID());
	}
	
	public ArrayList<Book> getBookByTitle(BookRequest bookRequest) {
		BookDAO dao = new BookDAO();
		return dao.getBookByTitle(bookRequest.getTitle());
	}

	public ArrayList<Book> getAllBooks() {
		BookDAO dao = new BookDAO();	
		return dao.getAllBooks();
	}

	public ArrayList<Book> getBookByAuthor(BookRequest bookRequest) {
		BookDAO dao = new BookDAO();
		return dao.getBookByAuthor(bookRequest.getAuthor());
	}

}

